var arr = [1, 2, 3, 4, 5]

var test = new Array(100, "a", true, 'i', 3.14)
console.log(test)

for (item in test) {
    console.log(typeof test[item])
}

console.log(test.length)
console.log(test[3])
console.log(test[test.length - 1])

// (1) pop
var array = [1, 2, 3, 4, 5]
var ret = array.pop();
console.log(array)  // [ 1, 2, 3, 4 ]
console.log(ret)   // 5

// (2) push
var array1 = [1, 2, 3, 4, 5]
array1.push("a")
console.log(array1)  // [ 1, 2, 3, 4, 5, 'a' ]

// (3) shift
var array2 = [1, 2, 3, 4, 5]
array2.shift()
console.log(array2) // [ 2, 3, 4, 5 ]

// unshift
var array3 = [1, 2, 3, 4, 5]
array3.unshift("alen")
console.log(array3)  //  [ 'alen', 1, 2, 3, 4, 5 ]

// reverse()
var array4 = [1, 2, 3, 4, 5]
array4.reverse()
console.log(array4)   //  [ 5, 4, 3, 2, 1 ]

// slice
var array5 = [1, 2, 3, 4, 5]
console.log(array5.slice(1, 4)); //  [ 2, 3, 4 ]

// concat()
var array6 = [1, 2, 3, 4, 5]
var array7 = [6, 7, 8, 9, 10]
var result = array6.concat(array7)
console.log(result) // [1, 2, 3, 4,  5, 6, 7, 8, 9, 10]

// join
var str = "广东-深圳-南山"
var after_split = str.split("-")
console.log(after_split); //  [ '广东', '深圳', '南山' ]

var strList = [ '广东', '深圳', '南山' ]
var string = strList.join("|")
console.log(string); // 广东|深圳|南山
